# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Jobs.V4.Model.Location do
  @moduledoc """
  A resource that represents a location with full geographic information.

  ## Attributes

  *   `latLng` (*type:* `GoogleApi.Jobs.V4.Model.LatLng.t`, *default:* `nil`) - An object representing a latitude/longitude pair.
  *   `locationType` (*type:* `String.t`, *default:* `nil`) - The type of a location, which corresponds to the address lines field of google.type.PostalAddress. For example, "Downtown, Atlanta, GA, USA" has a type of LocationType.NEIGHBORHOOD, and "Kansas City, KS, USA" has a type of LocationType.LOCALITY.
  *   `postalAddress` (*type:* `GoogleApi.Jobs.V4.Model.PostalAddress.t`, *default:* `nil`) - Postal address of the location that includes human readable information, such as postal delivery and payments addresses. Given a postal address, a postal service can deliver items to a premises, P.O. Box, or other delivery location.
  *   `radiusMiles` (*type:* `float()`, *default:* `nil`) - Radius in miles of the job location. This value is derived from the location bounding box in which a circle with the specified radius centered from google.type.LatLng covers the area associated with the job location. For example, currently, "Mountain View, CA, USA" has a radius of 6.17 miles.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :latLng => GoogleApi.Jobs.V4.Model.LatLng.t() | nil,
          :locationType => String.t() | nil,
          :postalAddress => GoogleApi.Jobs.V4.Model.PostalAddress.t() | nil,
          :radiusMiles => float() | nil
        }

  field(:latLng, as: GoogleApi.Jobs.V4.Model.LatLng)
  field(:locationType)
  field(:postalAddress, as: GoogleApi.Jobs.V4.Model.PostalAddress)
  field(:radiusMiles)
end

defimpl Poison.Decoder, for: GoogleApi.Jobs.V4.Model.Location do
  def decode(value, options) do
    GoogleApi.Jobs.V4.Model.Location.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Jobs.V4.Model.Location do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
